import {
  getFormatterPrice,
  computeRate
} from '@const/filter'

export const purchaseOrderProductListColumns = [
  { width: 45, type: 'selection' },
  { minWidth: '150', prop: 'companyProdCode', label: '产品编码', 'show-overflow-tooltip': true },
  { minWidth: '130', prop: 'prodNameCn', label: '产品名称', 'show-overflow-tooltip': true },
  { minWidth: '110', prop: 'spec', label: '规格', 'show-overflow-tooltip': true },
  { minWidth: '110', prop: 'model', label: '型号', 'show-overflow-tooltip': true }, // 1
  { minWidth: '90', prop: 'unit', label: '最小单位' }, // 1
  { prop: 'priceSale', label: '销售价格（元）', width: 170 },
  { prop: 'modelPrice', label: '模板价格（元）', width: 130 },
  { prop: 'priceDifference', label: '价格差异（元）', width: 130 },

  { minWidth: '170', prop: 'registNo', label: '注册证号/备案证号' },
  { minWidth: '150', prop: 'manufacturer', label: '生产厂家', 'show-overflow-tooltip': true },
  { width: '100',
    prop: 'category',
    label: '产品大类',
    formatter: row => PRODUCT_CATEGORY[row.bigType] },

  { width: '160', prop: 'saleNum', label: '销售数量' },
  { width: '130', prop: 'orderAmount', label: '小计金额（元）', formatter: row => getFormatterPrice(computeRate(row.count, row.salePrice) || 0) }, // 1
  { minWidth: '180', prop: 'upEnterpriseName', label: '供应商', 'show-overflow-tooltip': true },
  { width: '150', prop: 'platCode', label: '平台产品编码', 'show-overflow-tooltip': true }, // 1
  { width: '60', prop: 'action', label: '操作', fixed: 'right' }
]

// 注册地
export const PRODUCT_REGISTER_TYPE = {
  0: '国产',
  1: '港澳台',
  2: '进口'
}

// 产品大类
export const PRODUCT_CATEGORY = {
  1: '高值',
  2: '低值',
  3: '试剂',
  4: '设备',
  5: '低值'
}
export const sickSexOptions = [
  {
    value: 0,
    label: '男'
  },
  {
    value: 1,
    label: '女'
  }
]
